package com.xueyi.tesla.mapper;

import com.xueyi.game.backend.entity.dto.UpdateAccountDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 修改用户
 */
public interface UpdateAccountMapper {

    /**
     * 修改用户信息
     *
     * @param updateAccountDto
     */
    @Update(" <script>" +
            " update ${table} set u_name = #{req.uName},u_photo= #{req.uPhoto} " +
            " where id = #{req.id} " +
            " </script>")
    void updateAccount(@Param("req") UpdateAccountDto updateAccountDto, @Param("table") String table);

    /**
     * 修改密码
     *
     * @param updateAccountDto
     */
    @Update(" <script>" +
            " update ${table} set password = #{req.password} " +
            " where id = #{req.id} " +
            " </script>")
    void updatePassword(@Param("req") UpdateAccountDto updateAccountDto, @Param("table") String table);
}
